package com.qf.team2.netdisc.common.pojo.vo;

/**
 * 标准返回结果
 *
 * @author Simon_Wong
 * @date 2021/05/20
 * @since 2021/5/20 9:05
 */
public class RespResultVO<T> {
    /**
     * 状态
     */
    private Integer status;
    /**
     * 数据体
     */
    private T data;
    /**
     * 提示语句
     */
    private String message;

    public RespResultVO() {
    }

    public RespResultVO(Integer status, T data, String message) {
        this.status = status;
        this.data = data;
        this.message = message;
    }

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    public T getData() {
        return data;
    }

    public void setData(T data) {
        this.data = data;
    }

    public String getMessage() {
        return message;
    }

    public void setMessage(String message) {
        this.message = message;
    }

    @Override
    public String toString() {
        return "RespResultVO{" +
                "status=" + status +
                ", data=" + data +
                ", message='" + message + '\'' +
                '}';
    }

    /**
     * 状态码
     *
     * @author Administrator
     * @date 2021/05/20
     */
    public enum StatusCode {
        /**
         * 失败
         */
        FAILED(0),

        /**
         * 成功
         */
        SUCCESS(1),

        /**
         * 业务异常
         */
        BUSINESS_EXCEPTION(2);

        private final int VALUE;

        StatusCode(int value) {
            this.VALUE = value;
        }

        public int getValue() {
            return VALUE;
        }
    }
}
